{% extends 'base.html' %}
{% load i18n %}

{% block head %}
  <script src="{{ STATIC_URL }}js/articles.js"></script>
{% endblock head %}

{% block main %}
  <ol class="breadcrumb">
    <li><a href="{% url 'articles' %}">{% trans 'Articles' %}</a></li>
    <li class="active">{% trans 'Drafts' %}</li>
  </ol>
  <table class="table table-striped">
    <thead>
      <tr>
        <th>{% trans 'Title' %}</th>
        <th>{% trans 'Content' %}</th>
        <th>{% trans 'Tags' %}</th>
      </tr>
    </thead>
    <tbody>
      {% for article in drafts %}
        <tr>
          <td><a href="{% url 'edit_article' article.pk %}">{{ article.title }}</a></td>
          <td>{{ article.get_summary_as_markdown|safe }}</td>
          <td>
            {% for tag in article.get_tags %}
              <span class="label label-default">{{ tag }}</span>
            {% endfor %}
          </td>
        </tr>
      {% empty %}
        <tr>
          <td colspan="4" style="text-align: center">
            {% trans 'No draft to display' %}
          </td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
{% endblock main %}
